package concurrency

import (
	"fmt"
	"sync"
	"time"
)

var lock sync.Mutex

func print(str string) {
	lock.Lock()
	defer lock.Unlock()

	for _, c := range str {
		time.Sleep(1 * time.Second)
		fmt.Printf("%c", c)
	}
}

func main() {
	go print("aaa")
	go print("bbb")
	select {}
}
